package com.ers.modelconvert;

import com.ers.model.UserInfo;
import com.ers.validmodel.UserInfoModel;

public class UserInfoConvert {
	
	public static UserInfo toUserInfo(UserInfoModel userInfoModel) {
		UserInfo ui = new UserInfo();
		ui.setId(userInfoModel.getId());		
		ui.setBirth(userInfoModel.getBirth());
		ui.setExperience(userInfoModel.getExperience());
		ui.setLivePlace(userInfoModel.getLivePlace());
		ui.setMailbox(userInfoModel.getMailbox());
		ui.setName(userInfoModel.getName());
		ui.setPaperId(userInfoModel.getPaperType());
		ui.setPaperType(userInfoModel.getPaperType());
		ui.setPhone(userInfoModel.getPhone());
		ui.setSex(userInfoModel.getSex());
		ui.setPhotopath(userInfoModel.getPhotopath());
		return ui;
	}
	
	public static UserInfoModel toUserInfoModel(UserInfo userInfo){
		UserInfoModel uim = new UserInfoModel();
		uim.setId(userInfo.getId());
		uim.setBirth(userInfo.getBirth());
		uim.setExperience(userInfo.getExperience());
		uim.setLivePlace(userInfo.getLivePlace());
		uim.setMailbox(userInfo.getMailbox());
		uim.setName(userInfo.getName());
		uim.setPaperId(userInfo.getPaperType());
		uim.setPaperType(userInfo.getPaperType());
		uim.setPhone(userInfo.getPhone());
		uim.setSex(userInfo.getSex());
		uim.setPhotopath(userInfo.getPhotopath());
		return uim;
	}
}
